The Dreamweaver JavaScript API > JavaScript Debugger functions > dom.instrumentDocument () |
![]() ![]() ![]() |
Availability
Dreamweaver 4.0
Description
Creates the debug version of the document and any external .js files it references. This function parses the JavaScript in the document and calls the debuggerModule
for code snippets to insert at various points in the JavaScript file. The debuggerModule
is also notified of syntax errors and warnings. This function fails under any of the following conditions: syntax errors, a file error, or the document cannot be debugged for some reason. Temporary files are never deleted immediately, even if the function fails.
Arguments
debuggerModule
, outputFileName
![]() |
debuggerModule is the name of a special Dreamweaver module file that implements the instrumentation API. The module is located in the Configuration/Debugger folder of the Dreamweaver Program Files directory. |
![]() |
outputFileName is optional; it is the name to use for the debug version of the .htm file. If omitted, a temporary file is created. The temporary file is deleted when Dreamweaver exits. If the specified outputFileName exists, the existing file is replaced. The file is always written in the same directory as the source document, so it cannot have the same name as the source document. If a path is specified, it is ignored. The debug version of externally referenced .js files is named by adding outputFileName to the beginning of the original file name of the .js file. |
Returns
An array of pairs of file URLs. Each pair consists of the URL of the original source file followed by the URL of the debug version that was created. The first pair is always the .htm files and any subsequent entries are .js files referenced by the .htm file. If the function fails, then null
is returned. Note that a pair of URLs is actually two entries in the array. So, if returnValue = dom.instrumentDocument(test.htm)
, then returnValue[0]
is the URL of test.htm and returnValue[1]
is the URL of the debug version of test.htm.
![]() ![]() ![]() |